#include "CMsg.h"

CMsg::CMsg() {
  m_hWnd = NULL;
  m_proc.Add(this);
}

CMsg::~CMsg() {
  m_proc.Remove(this);
}

HWND CMsg::GetHandle() {
  return m_hWnd;
}

void CMsg::SetHandle(HWND hWnd) {
  m_hWnd = hWnd;
}

LRESULT CMsg::SendMessage(UINT uMsg, LPARAM lParam, WPARAM wParam) {
  return ::SendMessage(m_hWnd, uMsg, lParam, wParam);
}

LRESULT CMsg::PostMessage(UINT uMsg, LPARAM lParam, WPARAM wParam) {
  return ::PostMessage(m_hWnd, uMsg, lParam, wParam);
}

LRESULT CMsg::OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) {
  return ::DefWindowProc(m_hWnd, uMsg, wParam, lParam);
}

